package com.asy.ui.base;

import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.xinzhang.R;

public class ShowmeCache {

	 private View baseView;  
     private TextView titleTextView;
     private TextView descextView;
     private TextView timeTextView;
     private ImageView imageView;
     private Button commeButton;
     private Button commelistButton;
     private Button menubutton;
     private int width;
     
     public Button getMenubutton() {
    	 
    	 if(menubutton==null)
    	 {
    		 menubutton=(Button)baseView.findViewById(R.id.btn_menu);
    	 }
		return menubutton;
	}

	public Button getCommeButton() {
    	 if(commeButton==null)
    	 {
    		 commeButton=(Button)baseView.findViewById(R.id.btn_comment);
    	 }
		return commeButton;
	}

	public Button getCommelistButton() {
		if(commelistButton==null)
		{
			commelistButton=(Button)baseView.findViewById(R.id.btn_commentcount);
		}
		return commelistButton;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public ShowmeCache(View baseView) {  
         this.baseView = baseView;  
     }  
 	
     public ImageView getImageView() {  
         if (imageView == null) {  
        	 
             imageView = (ImageView) baseView.findViewById(R.id.comment_image);  
             LinearLayout.LayoutParams topLayoutParams=new LinearLayout.LayoutParams(width,width);
             imageView.setLayoutParams(topLayoutParams);
         }  
         return imageView;  
     }

	public TextView getTitleTextView() {
		if(titleTextView==null)
		{
			titleTextView=(TextView)baseView.findViewById(R.id.txtTtitle);
		}
		return titleTextView;
	}

	

	public TextView getDescTextView() {
		if(descextView==null)
		{
			descextView=(TextView)baseView.findViewById(R.id.txtDesc);
		}
		return descextView;
		
	}

	public TextView getTimeTextView() {
		
		if(timeTextView==null)
		{
			timeTextView=(TextView)baseView.findViewById(R.id.txtAddtime);
		}
		return timeTextView;
	}
}
